package com.show.service.impl;

import com.show.mapper.TraineeMapper;
import com.show.mapper.UserMapper;
import com.show.pojo.User;
import com.show.service.UserService;
import com.show.utils.SqlSessionFactoryUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

/**
 * @author 绛河
 */
public class UserServiceImpl implements UserService {
    SqlSessionFactory factory = SqlSessionFactoryUtils.getSqlSessionFactory();
    @Override
    public User selectByStuNumAndPassword(String stuNum, String password) {
        SqlSession sqlSession = factory.openSession();
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
        User user = mapper.selectByStuNumAndPassword(stuNum, password);
        return user;
    }
}
